<?php
/**
 * Created by PhpStorm.
 * User: cen
 * Date: 2020/6/29
 * Time: 18:50
 */

namespace app\admin\model;


use think\Model;

class ImageModel extends Model
{
    protected $table = 'image';
    protected $autoWriteTimestamp = true;
    protected $updateTime = false;


    public function getTypeAttr($value)
    {
        $arr = [1 => '资讯轮播',2=>'banner图',3 => '英雄轮播'];
        return $arr[$value];
    }

    // 定义全局的查询范围
    protected function base($query)
    {
        $query->where('status',0);
    }


}